<?php
/**
 * Created by PhpStorm.
 * User: winleung
 * Date: 2019-10-27
 * Time: 22:33
 */

namespace app\api\model;


use think\Db;
use think\Exception;
use think\Model;

class OrderLogistics extends Model
{
    protected $table = 'order_logistics';

    public function insertLogisticsData($data)
    {
        $result = Db::name($this->table)->insertGetId($data);

        return 0 < $result;
    }

    public function updateLogistics($where, $data)
    {
        $result = 0;
        try {

            $result = Db::name($this->table)
                ->where($where)
                ->update($data);
        } catch (Exception $e) {
            throwBusinessException("更新失败");
        }

        return 0 < $result;
    }
}